#define _CRT_SECURE_NO_WARNINGS 1
/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     struct TreeNode *left;
 *     struct TreeNode *right;
 * };
 */
int calculateDepth(struct TreeNode* root) {
    if (root == NULL)
        return 0;
    if (root->left == 0 && root->right == 0)
        return 1;
    int left = calculateDepth(root->left);
    int right = calculateDepth(root->right);
    return left > right ? left + 1 : right + 1;
}